package com.ruoyi.web.controller.demo.controller;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.web.service.DemoTestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("demo/test")

public class DemoTestController {
    private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);

    @Resource
    private DemoTestService demoTestService;

    @RequestMapping("/getUser")
    @ResponseBody
    public String Test01(){

        return demoTestService.getUser();
    }


    @RequestMapping("/getHrmResource")
    @ResponseBody
    @DataSource(DataSourceType.OA)
    public String HrmResource(){

        return demoTestService.getHrmResource();
    }
}
